//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_1281 {
    public demo_1281() {
    }

    public int subtractProductAndSum(int n) {
        int sum = 0;

        int product;
        for(product = 1; n > 10; n /= 10) {
            int temp = n % 10;
            sum += temp;
            product *= temp;
        }

        return product - sum;
    }
}
